// 引入 iconfont.css 和 iconfont.js
import '@/assets/icon-font/iconfont.css'
import '@/assets/icon-font/iconfont.js'

// ElementPlus 依赖
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'

// 导入Element-plus图标
// import * as ElementPlusIconsVue from '@element-plus/icons-vue'

import zhCn from 'element-plus/es/locale/lang/zh-cn'

// 自己的样式
import './assets/main.css'

// router 依赖
import router from '@/router/index.js'

// 全局方法
import Notification from '@/utils/notification.js'

// Pinia 依赖
import { createPinia } from 'pinia'

// Pinia 持久化 pinia-plugin-persistedstate
import piniaPluginPersistedstate from 'pinia-plugin-persistedstate'

// 全局组件
import ImageViewer from './components/ImageViewer.vue'

// Vue
import { createApp } from 'vue'
import App from './App.vue'

const app = createApp(App)
const pinia = createPinia()
pinia.use(piniaPluginPersistedstate)

app.use(ElementPlus, {
  locale: zhCn,
})
app.use(router)
app.use(pinia)

// for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
//   app.component(key, component)
// }

// 注册为全局方法(一个用于注册能够被应用内所有组件实例访问到的全局属性的对象。)
app.config.globalProperties.Notification = Notification

// 注册为全局组件
app.component("ImageViewer", ImageViewer)

app.mount('#app')